import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path';
import { viteMockServe } from 'vite-plugin-mock'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    viteMockServe({
      mockPath: 'mock',
      enable: true,
      logger: true,
      watchFiles:false
    })
  ],
  resolve: {
    extensions: [".vue", ".jsx", ".tsx", ".ts", ".json", ".js"],
    alias: [
      {
        find: '@',
        replacement: path.resolve(__dirname, './src') // "/src",
      }
    ],
  },
  css: {
    preprocessorOptions: {
      scss: {
        javascriptEnabled: true,
        additionalData: `    
         @import '@/assets/scss/variable.scss';
         @import '@/assets/scss/mixin.scss';
       `
      }
    }
  },
  server: {
    port: 3000,
  }
})
